package com.easycarebn.main.adapter;

import java.util.List;

import android.content.ClipData.Item;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.easycarebn.main.fragment.FragmentPageTab;

public class FragmentAdapter extends FragmentStatePagerAdapter {

	private List<String> TITLES;
	private int menuActive;
	private Item item;


	public FragmentAdapter(FragmentManager fm, List<String> TITLES,
			int menuActive, Item item) {
		super(fm);
		this.TITLES = TITLES;
		this.menuActive = menuActive;
		this.item = item;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return TITLES.get(position);
	}

	@Override
	public int getCount() {
		return TITLES.size();
	}

	@Override
	public Fragment getItem(int position) {
		return FragmentPageTab.newInstance(position, menuActive, item);
	}

}